package com.clone;

public class Clone implements Cloneable{

    public String s = "dd";



    public static void main(String[] args) throws CloneNotSupportedException {

        Human human = new Human();
        Mouth mouth = new Mouth();
        human.setAge("17");
        mouth.setSm("ttt");
        human.setMouth(mouth);

        Human human1 = (Human) human.clone();

        System.out.println(System.identityHashCode(human));
        System.out.println(System.identityHashCode(human1));

        System.out.println(System.identityHashCode(human.getMouth()));
        System.out.println(System.identityHashCode(human1.getMouth()));


    }


    public static void test1() throws CloneNotSupportedException {

        Clone c = new Clone();
        System.out.println(c);
        Clone c1 = (Clone) c.clone();
        System.out.println(c1);

        System.out.println(c.s.hashCode());
        System.out.println(c1.s.hashCode());

        System.out.println(System.identityHashCode(c.s));
        System.out.println(System.identityHashCode(c1.s));
        System.out.println(System.identityHashCode(new String("dd")));
        String s1 = "dd";
        String s2 = "dd";
        String s3 = "d";
        System.out.println(System.identityHashCode(s1.substring(0, 1)));
        System.out.println(System.identityHashCode(s3));
        System.out.println(System.identityHashCode("d"));

    }
}
